import math
import os
def sum(a,b):
    return (a+b)
def sub(a,b):
    return (a-b)
def mul(a,b):
    return (a*b)
def div(a,b):
    if b == 0:
        print("Error")
        return b
    return (a/b)
def Pysin(a):
    return math.sin(math.radians(a))
def Pycomplex(a,b):
    complexOper = input("请输入复数的运算符+ - * /:")
    if complexOper == "+":
        return a+b
    elif complexOper == "-":
        return a-b
    elif complexOper == "*":
        return a*b
    elif complexOper == "/":
        return a/b
def Pylog(a,b):
    return math.log(b,a)
print("============欢迎来到凌晨4点的曼巴============")
print("             作者:科比 布莱恩特              ")
flag = True
while flag:
    a = eval(input("请输入a:"))
    b = eval(input("请输入b:"))
    operator = input("请输入运算符(+ - * / sin com log):")
    if operator == "+":
        print("a+b = ",sum(a,b))
    elif operator == "-":
        print("a-b = ",sub(a,b))
    elif operator == "*":
        print("a*b = ",mul(a,b))
    elif operator == "/":
        print("a/b = ",div(a,b))
    elif operator == "sin":
        print("a = ",Pysin(a))
        print("b = ",Pysin(b))
    elif operator == "com":
        print("结果为: ",Pycomplex(a,b))
    elif operator == "log":
        print("结果为: ", Pylog(a, b))
    flag = False if input("是否要继续？Y or N: ") == "N" else True
    os.system("Pause")